<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>响应式简单个性个人博客模板</title>
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<link rel="stylesheet" type="text/css" href="statics/css/index.css" media="all" />
	<script type="text/javascript" src="layui/layui.all.js"></script>
</head>
<body>
		<jsp:include   page="top.jsp" flush="true"/>
		<div id="main" class="content">
			<div class="container">
				<article itemscope="itemscope">
					<div class="posts-list js-posts">
						<!-- <div class="post post-layout-list" data-aos="fade-up">
							<div class="status_list_item icon_kyubo">
								<div class="status_user" style="background-image: url(statics/images/b0ce3f3cde0c084b6d42321b2dcbc407.jpeg);">
									<div class="status_section">
										<a href="detail.html" class="status_btn">交代是不可能交代的</a>
										<p class="section_p">相隔上一次的更新我掰手指数一数，下意识的双腿一软，给各位小哥哥小姐姐们跪下了。自从有了对象后，周末几乎落下了主题的进度（邪魅的笑）。一边开发新的主题，一边收集您们给我反馈回来的"臭虫"，还有新的主题后台看见了一些大神在... </p>
									</div>
								</div>
							</div>
						</div> -->
					<div id="box">
						<c:forEach var="list" items="${list}">
						<div class="post post-layout-list" data-aos="fade-up">
							<div class="postnormal review ">
								<div class="post-container review-item">
									<div class="row review-item-wrapper">
										<div class="col-sm-3">
											<a rel="nofollow" href="checkblogs?blogs_id=${list.blogs_id }" target="_blank">
												<div class="review-item-img" style="background-image: url(statics/images/b0ce3f3cde0c084b6d42321b2dcbc407.jpeg);"></div>
											</a>
										</div>
										<div class="col-sm-9 flex-xs-middle" style="color: black;">
											<div class="review-item-title">
												<a href="checkblogs?blogs_id=${list.blogs_id }" target="_blank" rel="bookmark" style="color:black;">${list.blogs_title }</a>
											</div>
											<div class="review-item-creator"><b>发布日期：</b>${ list.blogs_createtime }</div>
											<span class="review-item-info"><b>转发数：</b>${ list.blogs_zfcount }</span>
											<span class="review-item-info"><b>点赞数：</b>${ list.blogs_dzcount }</span>
											<span class="review-item-info"><b>作者：</b>${ list.user_id.user_username }</span>
										</div>
									</div>
									<div class="review-bg-wrapper">
										<div class="bg-blur" style="background-image: url(statics/images/diego-ph-249471-2-800x1000.jpg);"></div>
									</div>
								</div>
								<div class="post-container">
									<%-- <div class="entry-content">${ list.blogs_content}</div> --%>
									<div class="post-footer">
										<a class="gaz-btn primary" onclick="openw('${list.blogs_id}')" href="javascript:void(0)" >READ MORE</a>
										<c:if test="${user.role.r_id>1}"><span class="total-comments-on-post pull-right"><a href="javascript:void(0)" onClick="del(${list.blogs_id })">删除 </a></span></c:if> 
									</div>
								</div>
							</div>
						</div>
						</c:forEach>
						</article>
						</div>
						</div>
						<!-- <div class="post post-layout-list" data-aos="fade-up">
							<div class="status_list_item icon_kyubo">
								<div class="status_user" style="background-image: url(statics/images/b0ce3f3cde0c084b6d42321b2dcbc407.jpeg);">
									<div class="status_section">
										<a href="detail.html" class="status_btn">状态</a>
										<p class="section_p">因为我这后半年飘忽不定的更新节奏，感觉真的对不住用户。最近才松下来能处理反馈的bug，顺便加快新主题 Dcras 的制作，农历年后或许能上线，准确时间，不敢说-- 为了感谢大家对 Yarn 的支持，Dcras 会以 获兑现码半价的承诺 给 Yarn ... </p>
									</div>
								</div>
							</div>
						</div> -->
						<!-- <div class="post post-layout-list js-gallery" data-aos="fade-up">
							<div class="post-album">
								<div class="row content">
									<div class="bg" style="background-image: url(statics/images/IMG_0150.jpg);"></div>
									<div class="contentext flex-xs-middle">
										<div class="album-title">
											<a href="detail.html">重构图像样式测试</a>
										</div>
										<h5 class="review-item-creator"><b>发布日期：</b>2017-11-13</h5>
										<div class="album-content">如眼所见是一个图像样式，必须写五十左右的文字作为这个文本框的空白填充，不写也是可以的，强迫症不能容忍空白。</div>
									</div>
									<div class="album-thumb-width flex-xs-middle">
										<div class="row album-thumb no-gutter">
											<div class="col-xs-4"><img class="thumb" src="statics/images/IMG_0150-250x250.jpg" /></div>
											<div class="col-xs-4"><img class="thumb" src="statics/images/IMG_0149-250x250.jpg" /></div>
											<div class="col-xs-4"><img class="thumb" src="statics/images/IMG_0146-250x250.jpg" /></div>
											<div class="col-xs-4"><img class="thumb" src="statics/images/IMG_0147-250x250.jpg" /></div>
											<div class="col-xs-4"><img class="thumb" src="statics/images/IMG_0148-250x250.jpg" /></div>
											<div class="col-xs-4">
												<a href="">5 pics</a>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div> -->
						<!-- <div class="post post-layout-list" data-aos="fade-up">
							<div class="postnormal review ">
								<div class="post-container review-item">
									<div class="row review-item-wrapper">
										<div class="col-sm-3">
											<a rel="nofollow" href="detail.html">
												<div class="review-item-img" style="background-image: url(statics/images/47fb3c_9afed6c259f94589881bd55376206366mv2_d_3840_5784_s_4_2-800x450.jpg);"></div>
											</a>
										</div>
										<div class="col-sm-9 flex-xs-middle">
											<div class="review-item-title">
												<a href="detail.html" rel="bookmark">给大家介绍一下</a>
											</div>
											<div class="review-item-creator"><b>发布日期：</b>2017-10-02</div>
											<span class="review-item-info"><b>总浏览量：</b>1600 reads</span>
										</div>
									</div>
									<div class="review-bg-wrapper">
										<div class="bg-blur" style="background-image: url(statics/images/47fb3c_9afed6c259f94589881bd55376206366mv2_d_3840_5784_s_4_2-800x450.jpg);"></div>
									</div>
								</div>
								<div class="post-container">
									<div class="entry-content">现在的明星的影响力足以影响国内娱乐圈的"半壁江山"，发条微博，新浪都恐慌好几天，来来来，蹭个热点给大家介绍一下我的女朋友。</div>
									<div class="post-footer">
										<a class="gaz-btn primary" href="detail.html">READ MORE</a>
										<span class="total-comments-on-post pull-right"><a href="">30 Comments</a></span>
									</div>
								</div>
							</div>
						</div>
					</div>
					post-formats end Infinite Scroll star
					post-formats
					<div class="pagination js-pagination">
						<div class="js-next pagination__load">
							<a href=""><i class="iconfont">&#xe605;</i></a>
						</div>
					</div> -->
					<!-- -pagination  -->
			</div>
		</div>
		<footer id="footer" class="overlay animated from-top" style="text-align: center;">
			<div class="decor-wrapper">
				<svg id="footer-decor" class="decor top" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100" preserveAspectRatio="none">
					<path class="large left" d="M0 0 L50 50 L0 100" fill="rgba(255,255,255, .1)"></path>
					<path class="large right" d="M100 0 L50 50 L100 100" fill="rgba(255,255,255, .1)"></path>
					<path class="medium left" d="M0 0 L50 50 L0 66.6" fill="rgba(255,255,255, .3)"></path>
					<path class="medium right" d="M100 0 L50 50 L100 66.6" fill="rgba(255,255,255, .3)"></path>
					<path class="small left" d="M0 0 L50 50 L0 33.3" fill="rgba(255,255,255, .5)"></path>
					<path class="small right" d="M100 0 L50 50 L100 33.3" fill="rgba(255,255,255, .5)"></path>
					<path d="M0 0 L50 50 L100 0 L0 0" fill="rgba(255,255,255, 1)"></path>
					<path d="M48 48 L50 51 L52 48 L48 48" fill="rgba(255,255,255, 1)"></path>
				</svg>
			</div>
		</footer>
		<div style="text-align: center;">
					<a href="Javascript:void(0)" id="jz">点击加载</a>
		</div>
			<jsp:include   page="bottom.jsp" flush="true"/>
</body>

<script type="text/javascript">
function openw(data){
	window.open('checkblogs?blogs_id='+data,data,'',true);
	
}
function del(id){
	layer.confirm('您确定要删除ta的博客吗？', {
			btn: ['确定','取消'] //按钮
		}, 
		function(){
			layer.closeAll('dialog');
			$.ajax({
				type: "post",
				url: "delblogs",
				data: {
					_method:"DELETE",
					id: id
				},
				success : function(data){
				 	//alert(data);
				 	if(data){
				 		$.ajax({
				 			url:'sendemail',
				 			type:'post',
				 			data:{
				 				id:id
				 			},
				 			success:function(a){
				 				alert(a);
				 			}
				 		})
				 		window.location.reload();
				 		//等会写发送邮箱提示
				 		
				 	}
				}
			});
		})
}
	var page=1;
	$(function(){
		
		$("#jz").click(function(){
			if($("#jz").html()!="已经到了底部哦。。。"){
				$.ajax({
					url:"loadblogs",
					type:"post",
					data:{
						page:page,
					},
					success:function(data){
						console.log(data);
						if(data=="true"){
							/* window.location.reload(); */
							$("#main").load(location.href+" #main");
						}else{
							$("#main").load(location.href+" #main");
							$("#jz").html("已经到了底部哦。。。");
							/* window.location.reload(); */
							/* $("#box").load(location.href+" #box"); */
						}
					}
				})
			}
		})
	})
</script>
</html>